
import 'package:baselib/utils/navigator_util.dart';
import 'package:framelib/base/base_view_model.dart';
import 'package:framelib/config/route_config.dart';
import 'package:get/state_manager.dart';
import 'package:get/get.dart';
import 'package:module_business/module_comm/service/module_comm_service.dart';

class LoginViewModel extends BaseViewModel<ModuleCommService>{

  String account = '';
  String password = '';
  //是否同意用户协议
  RxBool isAgreementSelected=true.obs;
  ModuleCommService moduleCommService;

  @override
  ModuleCommService createService() =>moduleCommService = ModuleCommService();


  //去用户协议页面
  toUserAgreement() async {
    // NavigatorUtil.pushByName(RouteConfig.commUrlPage,arguments: {
    //   'title':StringUtils.useprivacyagreement,
    //   'url':DrawableUtils.digtalts_privacy,
    //   'isAssets':true
    // });
  }

  selectAgreement() {
    isAgreementSelected.value=!isAgreementSelected.value;
  }

  isValidate() {
    // if(account.isEmpty){
    //   ToastUtils.toast(StringUtils.pleaseinput+StringUtils.account);
    //   return false;
    // }
    // if(password.isEmpty){
    //   ToastUtils.toast(StringUtils.pleaseinput+StringUtils.password);
    //   return false;
    // }
    return true;
  }

  toTermsOfService() {}

  toPrivacyPolicy() {}

  toEmailSignIn() {
    NavigatorUtil.pushByName(RouteConfig.loginEmailPage);
  }

}
